ws2812 library  v0.85
Supports ws2812 and ws2812b
Data Structures | Functions
ws2812.c File Reference

Driver for WS2812 and WS2812B RGB LEDs. More...

#include <propeller.h>
#include "ws2812.h"

Data Structures

struct  ws2812_hdr

Functions

int ws_start (ws2812_t *state, int usreset, int ns0h, int ns0l, int ns1h, int ns1l, int type)
 Load a COG with a driver using custom parameters.
void ws2812_set (ws2812_t *state, int pin, uint32_t *colors, int count)
 Set color pattern on a chain of LEDs.

Detailed Description

Driver for WS2812 and WS2812B RGB LEDs.

Author
Parallax Inc.
Version
0.85

Function Documentation

void ws2812_set ( ws2812_t driver,
int  pin,
uint32_t *  colors,
int  count 
)

Set color pattern on a chain of LEDs.

Parameters
driverPointer to the driver structure
pinPin connected to the first LED
colorsArray of colors, one for each LED in the chain
countNumber of LEDs in the chain
int ws_start ( ws2812_t driver,
int  usreset,
int  ns0h,
int  ns0l,
int  ns1h,
int  ns1l,
int  type 
)

Load a COG with a driver using custom parameters.

Parameters
usresetReset timing (us)
ns0h0-bit high timing (ns)
ns0l0-bit low timing (ns)
ns1h1-bit high timing (ns)
ns1l1-bit low timing (ns)
typecolor format (either TYPE_RGB or TYPE_GRB)
Returns
Driver COG number or -1 on failure